﻿@{
    ViewBag.Title = "WaitTasks";
    string json = ViewData["json"].ToString();
    Newtonsoft.Json.Linq.JObject jObject = Newtonsoft.Json.Linq.JObject.Parse(json);
    if (jObject.Value<int>("errcode") != 0)
    {
        string errmsg = jObject.Value<string>("errmsg");
        Response.Write(errmsg);
        Response.End();
        return;
    }
}
<form method="post">
    <div class="querydiv">
        标题：<input type="text" id="tasktitle" name="tasktitle" value="@ViewData["taskTitle"]" />
        &nbsp;流程：<select id="flowid" name="flowid"><option></option>@(Html.Raw(ViewData["flowOptions"]))</select>
        <input type="submit" value="查询" />
    </div>
    <table class="listtable" border="1">
        <thead>
            <tr>
                <th>流程</th>
                <th>步骤</th>
                <th>任务名称</th>
                <th>发送人</th>
                <th>接收时间</th>
                <th>备注</th>
                <th></th>
            </tr>
        </thead>
        <tbody>
            @foreach (Newtonsoft.Json.Linq.JObject task in jObject.Value<Newtonsoft.Json.Linq.JArray>("data"))
            {
                <tr>
                    <td>@(task.Value<string>("flowname"))</td>
                    <td>@(task.Value<string>("stepname"))</td>
                    <td>@(task.Value<string>("title"))</td>
                    <td>@(task.Value<string>("sendername"))</td>
                    <td>@(task.Value<string>("receivetime"))</td>
                    <td>@(task.Value<string>("note"))</td>
                    <td><input type="button" value="处理" onclick="window.location='FlowRun?flowid=@(task.Value<string>("flowid"))&stepid=@(task.Value<string>("stepid"))&taskid=@(task.Value<string>("id"))&groupid=@(task.Value<string>("groupid"))&instanceid=@(task.Value<string>("instanceid"))';" />
                        <input type="button" value="查看" onclick="show('@(task.Value<string>("groupid"))');" />
                    </td>
                </tr>
            }
        </tbody>
    </table>
</form>
<script>
    function show(groupId) {
        common.open('ShowTasks?groupid=' + groupId, 900, 500, "back");
    }
</script>
